package cn.tedu.spring.config;

import cn.tedu.spring.di.UserService;
import cn.tedu.spring.life.DBCConnect;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/*
测试类  测试@ComponentScan注解
 */
public class TestScan {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(AppConfig.class);

        UserService userService = context.getBean(UserService.class);
        System.out.println("service="+userService);

        DBCConnect dbcConnect = context.getBean(DBCConnect.class);
        System.out.println("dbConnect="+dbcConnect);
    }
}
